const {
	db,
	dbCmd,
	result_success,
	result_error,
	appletInfoCollection,
	shopieCollection,
	userCollection
} = require('../../common/constants')
module.exports = async function(params = {}) {
	const token = this.getUniIdToken()
	if (!token) {
		return result_error('登录失效,请重新登录')
	}
	let payload = await this.uniID.checkToken(token)
	if (payload.code) {
		return payload
	}
	let id = params._id
	if (!id) {
		return result_error('id错误')
	}
	let profitsharingData = await db.collection('wmzmall-profitsharing').doc(id).get()
	profitsharingData = profitsharingData.data[0]
	return result_success(profitsharingData)
}